package com.hzqy.persistence.dao.hqjc;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.activity.ActivityAwardVo;
import com.hzqy.web.vo.AcLotteryVo;
import com.hzqy.web.vo.AcRecordVo;
import com.hzqy.web.vo.AcWinningVo;
import com.hzqy.web.vo.PmsUserVo;
import com.hzqy.web.vo.AcGameVo;

@Repository
public class ActivityDao extends PersistenceDao<PmsUserVo, Integer>{
	protected final Logger LOG = LoggerFactory.getLogger(ActivityDao.class);
	public int selectDaTi(AcRecordVo arv){
		return getSqlSession().selectOne(this.getNamespace() + "selectDaTi",arv);
	}
	public int selectDuiDuiPeng(AcRecordVo arv){
		return getSqlSession().selectOne(this.getNamespace() + "selectDuDuiPeng", arv);
	}

	public int insertLottery(AcLotteryVo alv) {
		return getSqlSession().insert(this.getNamespace() + "insertLottery", alv);
	}
	public int insertLotteryRecord(AcLotteryVo alv) {
		return getSqlSession().insert(this.getNamespace() + "insertLotteryRecord", alv);
	}

	public int updateLottery(AcLotteryVo alv) {
		return getSqlSession().update(this.getNamespace() + "updateLottery", alv);
	}
	
	public int selectLotteryCount(AcLotteryVo alv){
		return getSqlSession().selectOne(this.getNamespace() + "selectLotteryCount", alv);
	}
	public AcRecordVo  selectRecord(AcRecordVo arv){
		return getSqlSession().selectOne(this.getNamespace() + "selectRecord", arv);
	}
	public int selectTotalScore(AcRecordVo arv){
		return getSqlSession().selectOne(this.getNamespace()+"selectTotalScore",arv);
	}

	public int selectWinningCount(AcWinningVo awv){
		return getSqlSession().selectOne(this.getNamespace() + "selectWinningCount", awv);
	}
	public AcLotteryVo selectLottery(AcLotteryVo alv){
		return getSqlSession().selectOne(this.getNamespace() + "selectLottery", alv);
	}
	public Integer selectLotteryNum(AcLotteryVo alv){
		return getSqlSession().selectOne(this.getNamespace() + "selectLotteryNum", alv);
	}
	public Integer updateWinningCoun(AcLotteryVo aLv){
		return getSqlSession().update(this.getNamespace() + "updateWinningCoun", aLv);
	}
	public AcWinningVo selectWinning(AcWinningVo awv){
		return getSqlSession().selectOne(this.getNamespace() + "selectWinning", awv);
	}
	
	public int insertWinningList(AcWinningVo awv) {
		return getSqlSession().insert(this.getNamespace() + "insertWinning", awv);
	}
	
	public int updateWinning(AcWinningVo awv) {
		return getSqlSession().update(this.getNamespace() + "updateWinning", awv);
	}
	
	public List<AcWinningVo> selectWinningList(AcWinningVo awv){
		return getSqlSession().selectList(this.getNamespace() + "selectWinningList", awv);
	}
	
	public List<AcWinningVo> selectUWinningList(AcWinningVo awv){
		return getSqlSession().selectList(this.getNamespace() + "selectUWinningList", awv);
	}

	public int selectGameCount(AcGameVo agv){
		return getSqlSession().selectOne(this.getNamespace() + "selectGameCount", agv);
	}

	public int insertGameList(AcGameVo agv) {
		return getSqlSession().insert(this.getNamespace() + "insertGameList", agv);
	}
	
	public List<AcRecordVo> selectRecordList(AcRecordVo arv){
		return getSqlSession().selectList(this.getNamespace() + "selectRecordList", arv);
	}
    public int selectRecordCount(AcRecordVo arv){
        return getSqlSession().selectOne(this.getNamespace() + "selectRecordCount", arv);
    }
	public int selectRecordddp(AcRecordVo arv){
		return getSqlSession().selectOne(this.getNamespace() + "selectRecordddp", arv);
	}
    public int selectRecordllk(AcRecordVo arv){
        return getSqlSession().selectOne(this.getNamespace() + "selectRecordllk", arv);
    }
	
	public int insertUserMessage(AcRecordVo arv) {
		return getSqlSession().insert(this.getNamespace() + "insertUserMessage", arv);
	}
	
	public int updateRecord_phone(AcRecordVo arv) {
		return getSqlSession().update(this.getNamespace() + "updateRecord_phone", arv);
	}
	public int updateRecords(AcRecordVo arv) {
		return getSqlSession().update(this.getNamespace() + "updateRecords", arv);
	}
	public AcRecordVo selectRecordX_lwj_id(AcRecordVo arv){
		return getSqlSession().selectOne(this.getNamespace() + "selectRecordX_lwj_id", arv);
	}
	public int selectWinningDateCount(AcWinningVo awv){
		return getSqlSession().selectOne(this.getNamespace() + "selectWinningDateCount", awv);
	}
	public List<AcWinningVo> selectWinningList2(AcWinningVo awv){
		return getSqlSession().selectList(this.getNamespace() + "selectWinningList2", awv);
	}
	public List<ActivityAwardVo> selectActivityAward(int f_all_activityid){
		return getSqlSession().selectList(this.getNamespace() + "selectActivityAward", f_all_activityid);
	}
	public List<AcWinningVo> selectWinningList3(AcWinningVo awv){
		return getSqlSession().selectList(this.getNamespace() + "selectWinningList3", awv);
	}
	/** 
	* @Description: 查询某一个时间断内的抽奖次数
	* @Param:  * @param null 
	* @return:  
	* @Author: LiuL
	* @Date: 2019/6/17 
	*/ 
	public int selectLottCount(Map map){
		return getSqlSession().selectOne(this.getNamespace() + "selectLottCount", map);

	}

	public int selectAlwaysAwardINFo(Map map) {
		return getSqlSession().selectOne(getNamespace() + "selectAlwaysAwardINFo", map);
	}
	public List<AcWinningVo> selectWinningListLimit(AcWinningVo awv){
		return getSqlSession().selectList(this.getNamespace() + "selectWinningListLimit", awv);
	}
}
